package com.anjie.powerproject.strategy.repository;

import com.anjie.powerproject.strategy.pojo.WeatherEachHour;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;

public interface WeatherEachHourForecastRepository extends JpaRepository<WeatherEachHour, Integer> {

    @Query(nativeQuery = true,value = "select * from weather_forecast_hourly where DATE_FORMAT(sdate,'%Y-%m-%d') = DATE_FORMAT(?1,'%Y-%m-%d') and historycity_code = ?2")
    List<WeatherEachHour> getWeatherEachHoursBySdate(Date date,String cityCode);
}
